<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-menu default-active='active' mode='horizontal' class='menu-unit'>
      <el-menu-item v-for='item in Container1' :index="'检测方案项目列表'===item.name?'active':'default'">
        <el-link @click="gotoMenu(item.url)" :type="'检测方案项目列表'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
      </el-menu-item>
    </el-menu>
    <table cellpadding="4" cellspacing="0" border="0" width="100%">
      <tr>
        <td class="containerBack">
          <el-form ref="form" :model="s_produce" :rules="rules" label-width="100px" id="mvcfm">
            <el-button @click="gotoPage('/mes/product/CartogramTechnology?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
            <div class="form-unit">
              <span class="mvc-title-left"> 项目列表 </span>
            </div>
            <el-table :data="s_produce">
              <el-table-column label="#" align="center" type='index'>
              </el-table-column>
              <el-table-column label="项目条形码" prop="process_barcode">
              </el-table-column>
              <el-table-column label="项目名称" prop="process_name">
              </el-table-column>
              <el-table-column label="标准文件编号" prop="subject">
              </el-table-column>
              <el-table-column label="标准文件名称" prop="client_filename">
              </el-table-column>
              <el-table-column label="项目时长" prop="process_duration">
              </el-table-column>
              <el-table-column label="项目描述" prop="process_des">
              </el-table-column>
              <el-table-column label="项目管理岗位" prop="role">
              </el-table-column>
            </el-table>
          </el-form>
        </td>
      </tr>
    </table>
    <el-dialog :visible.sync="SetSetingRangVisible" append-to-body>
      <SetSetingRang v-if="SetSetingRangVisible" ref="SetSetingRang" :popparams="popparams"> </SetSetingRang>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import SetSetingRang from "@/views/mes/product/SetSetingRang";
  export default {
    name: 'ProgramItems',
    components: {
      SetSetingRang,
    },
    props: ['popparams'],
    data() {
      return {
        SetSetingRangVisible: false,
        SetSetingRangValue: null,
        SetSetingRangDesc: null,
        vueparams: this.getVUEParams(""),
        s_produce: [],
        loading: false,
        Container1: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "28847805EE1D403DBCD43478FD18BD08",
        name: "方案上菜单",
        selected: "检测方案项目列表"
      }, 'Container1', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/mes/product/TechnologyAction/programItems?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      d_phase(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/mes/product/TechnologyAction/d_phase?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      popSetSetingRang(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.SetSetingRangVisible = !this.SetSetingRangVisible;
      },
    },
  }
</script>
